package co.com.inventarios.modelo;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Tipoiva entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TIPOIVA", schema = "MANAGER", uniqueConstraints = {})
public class Tipoiva implements java.io.Serializable {

	// Fields

	private String ivacodigo;
	private String ivanombre;
	private Double ivaporcen;
	private Long ivaactivo;
	private Timestamp ivalogfec;
	private Dlluser dlluser;
	private Set<Producto> productos = new HashSet<Producto>(0);
	private Set<Mngmcn> mngmcns = new HashSet<Mngmcn>(0);

	// Constructors

	/** default constructor */
	public Tipoiva() {
	}

	/** minimal constructor */
	public Tipoiva(String ivacodigo) {
		this.ivacodigo = ivacodigo;
	}

	/** full constructor */
	public Tipoiva(String ivacodigo, String ivanombre, Double ivaporcen,
			Dlluser dlluser,Timestamp ivalogfec,
			Long ivaactivo, Set<Producto> productos, Set<Mngmcn> mngmcns) {
		this.ivacodigo = ivacodigo;
		this.ivanombre = ivanombre;
		this.ivaporcen = ivaporcen;
		this.dlluser = dlluser;
		this.ivalogfec = ivalogfec;
		this.ivaactivo = ivaactivo;
		this.productos = productos;
		this.mngmcns = mngmcns;
	}

	// Property accessors
	@Id
	@Column(name = "IVACODIGO", unique = true, nullable = false, insertable = true, updatable = true, length = 4)
	public String getIvacodigo() {
		return this.ivacodigo;
	}

	public void setIvacodigo(String ivacodigo) {
		this.ivacodigo = ivacodigo;
	}

	@Column(name = "IVANOMBRE", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public String getIvanombre() {
		return this.ivanombre;
	}

	public void setIvanombre(String ivanombre) {
		this.ivanombre = ivanombre;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "IVALOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "IVALOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getIvalogfec() {
		return this.ivalogfec;
	}

	public void setIvalogfec(Timestamp ivalogfec) {
		this.ivalogfec = ivalogfec;
	}
	
	@Column(name = "IVAPORCEN", unique = false, nullable = true, insertable = true, updatable = true, precision = 6)
	public Double getIvaporcen() {
		return this.ivaporcen;
	}

	public void setIvaporcen(Double ivaporcen) {
		this.ivaporcen = ivaporcen;
	}

	@Column(name = "IVAACTIVO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getIvaactivo() {
		return this.ivaactivo;
	}

	public void setIvaactivo(Long ivaactivo) {
		this.ivaactivo = ivaactivo;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "tipoiva")
	public Set<Producto> getProductos() {
		return this.productos;
	}

	public void setProductos(Set<Producto> productos) {
		this.productos = productos;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "tipoiva")
	public Set<Mngmcn> getMngmcns() {
		return this.mngmcns;
	}

	public void setMngmcns(Set<Mngmcn> mngmcns) {
		this.mngmcns = mngmcns;
	}

}